# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        黄周云  
# Name:         test14_8
# Description: 例14.8
# Author:       ASUS
# Date:         2019/4/17
#-------------------------------------------------------------------------------


import json
import dicttoxml
f = open('files/products.json','r',encoding='utf-8')
jsonStr = f.read()
#将json字符串转换成字典
d = json.loads(jsonStr)
print(d)
#将字典转换成xml字符串
xmlStr = dicttoxml.dicttoxml(d).decode('utf-8')
print(xmlStr)
f.close()


